#ifndef LOMINSTANCEHH
#define LOMINSTANCEHH
#include "lom-typedefs.hh"
#include "lom-root.hh"
#include "lom-events.hh"

namespace lom
{
    class LomClass;
    class ILomValueFactory;
    class LomInstance : public LomRoot, public EventSender
    {
    private:
	LomInstance( const LomInstance& other );
	LomInstance& operator=( const LomInstance& other );
    protected:
	const LomClass* cls;
	TValueVector values;
	ILomValueFactory* factory;

    public:
	LomInstance();
	LomInstance( const LomClass* _cls
		     , ILomValueFactory* factory
		     , ILomInstanceManager* mgr
		     , THandle reserveHandle = 0 );
	LomInstance( const LomInstance& other
		     , ILomValueFactory* factory
		     , ILomInstanceManager* mgr
		     , THandle reserveHandle );
	virtual ~LomInstance();
	virtual const LomClass* getClass() const;
	virtual void setClass( const LomClass* cls );
	virtual void setFactory( ILomValueFactory* factory );
	virtual void initialize( const LomClass*_cls
				 , ILomValueFactory* factory
				 , ILomInstanceManager* mgr
				 , THandle reserveHandle = 0 );
	virtual const LomValue& get( const licada::TNameStr& name ) const;
	virtual const LomValue& getIdx( licada::uint32 index ) const;
	virtual void set( const licada::TNameStr& name, const LomValue& value );
	virtual void setIdx( licada::uint32 index, const LomValue& value );
	virtual const TValueVector& getValues() const;
	virtual TValueVector& getValues();
    };
}
#endif
